package jzc.mzxy.datebinding;

import android.databinding.DataBindingUtil;
import android.databinding.ObservableField;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;

import jzc.mzxy.datebinding.moder.BannerModer;
import retrofit2.Call;
import retrofit2.Callback;
import retrofit2.Response;
import retrofit2.Retrofit;
import retrofit2.adapter.rxjava2.RxJava2CallAdapterFactory;
import retrofit2.converter.gson.GsonConverterFactory;

import static jzc.mzxy.datebinding.RetrofitUtils.retrofit;

public class RetrofitActivity extends AppCompatActivity {

    ObservableField<String> username=new ObservableField<>();
    ObservableField<String> password=new ObservableField<>();

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);

        setContentView(R.layout.activity_retrofit);



        Call<BannerModer> bannerModerCall =RetrofitUtils.getRetrofit().create(Apis.class).getBanner();
        bannerModerCall.enqueue(new Callback<BannerModer>() {
            @Override
            public void onResponse(Call<BannerModer> call, Response<BannerModer> response) {
                BannerModer bannerModer=response.body();
            }

            @Override
            public void onFailure(Call<BannerModer> call, Throwable throwable) {

            }
        });


    }
}
